<div class="container-fluid">
    <?php
//get item param from model
    $lession = $viewModel->get('lession');

    $sbjs = $viewModel->get("sbjs");
    if (!is_object($lession)) {
        echo 'Lession is not exist!';
    } else {
        ?>
        <h1>Update form</h1>
        <form class="form-horizontal" method="POST">
            <div class="control-group" style="display: none;">
                <label class="control-label" for="inputCourseID">ID</label>
                <div class="controls">
                    <input type="text" id="inputCourseID" name="lession_id" value="<?php echo $lession->lession_id; ?>">
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="inputLessionName">Lession Name</label>
                <div class="controls">
                    <input type="text" id="inputLessionName" name="lession_name" placeholder="Lession Name" value="<?php echo $lession->lession_name ?>" required="required">
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="inputLessionName">Subject Name</label>
                <div class="controls">
                    <select name="subject_id">
                        <?php
                        foreach ($sbjs as $sbj) {
                            $slt = ($lession->subject_id == $sbj->subject_id) ? " selected = 'selected'" : "";
                            echo "<option value='" . $sbj->subject_id . "'" . $slt . ">" . $sbj->subject_name . "</option>";
                        }
                        ?>
                    </select>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="inputTheory">Theory</label>
                <div class="controls">
                    <input type="text" id="inputTheory" name="theory"  value="<?php echo $lession->theory ?>" placeholder="Theory">
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="inputLab">Lab</label>
                <div class="controls">
                    <input type="text" id="inputLab" name="lab" placeholder="Lab"  required="required" value="<?php echo $lession->lab; ?>">
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="inputUsername">Status</label>
                <div class="controls">
                    <select name="status">
                        <option value="0" <?php echo ($lession->status == 0) ? "selected = 'selected'" : "" ?>>Deactive</option>
                        <option value="1" <?php echo ($lession->status == 1) ? "selected = 'selected'" : "" ?>>Active</option>
                    </select>
                </div>
            </div>
            <div class="control-group">
                <div class="controls">
                    <button type="submit" class="btn btn-success">Submit</button>
                    <button type="reset" class="btn">Reset</button>
                </div>
            </div>
        </form>
    <?php } ?>
</div>